|
|
|
|
|
|
|
The WithdrawFunds class encapsulates the business policy related to withdrawal transactions. Similarly, the DepositFunds class encapsulates the business policy related to deposit transactions. For every deposit, the CashDepositRecord class must be used to make sure a cash deposit doesn't exceed $10,000. If it does, a Cash Deposit Record form must be filled out by the bank teller online. The OpenAccount class enforces banking policy related to opening accounts. Of course, if an initial deposit is in the form of more than $10,000 cash, the CashDepositRecord class is used again. The CloseAccount class handles all rules related to closing an account, including making sure that if the account being closed is the last one the customer has with the bank, the customer has no outstanding debts with the bank. If the customer does have debts, the bank teller is notified, and the account is tracked until the debt is paid. |
|
|
|
|
|
|
|
|
These classes, which have been discussed in earlier lessons in this book, work in conjunction with the classes in the bank account product family, including the following: |
|
|
|
|
|
|
|
|
As mentioned in the lesson for Day 3, AccountCreator has the responsibility of creating the desired bank product when a bank teller, on behalf of a customer, opens an account. The BankAccountProduct class is an interface class that must be implemented by one of the other product classes. |
|
|
|
|
|
|
|
|
The CashDepositRecord has a public interface method, exceedsLimit, that checks the amount of the deposit. Listing 15.1 in this lesson shows the code in it, as well as the supporting code in ErrorHandler, the Enum eBusinessRules in modErrorHandling, and the code in the Deposit and DepositFunds classes. The other business rule enforcement code is too lengthy to reproduce as a code listing in this chapter, but the code follows the same general pattern as that of enforcing the $10,000 cash deposit limit. The next paragraph describes the methods involved in this rule. |
|
|
|
|
|